const path = require('path');
const  myPath=path.parse('C:\Users\zxw\Desktop\node\node-study\path.txt');
console.log(myPath);
//输出：
{
  root: 'C:',
  dir: 'C:',
  base: 'UserszxwDesktop\node\node-studypath.txt', // 该属性可以用于修改文件名和后缀
  ext: '.txt',
  name: 'UserszxwDesktop\node\node-studypath'
}
